App({
  onLaunch: function () {
    var n = this,
      s = wx.getStorageSync("logs") || [];
    s.unshift(Date.now()), wx.setStorageSync("logs", s), wx.login({
      success: function (ns) {
        code1 = ns.code;
      }
    }), wx.getSetting({
      success: function (s) {
        s.authSetting["scope.userInfo"] && wx.getUserInfo({
          success: function (s) {
            n.globalData.userInfo = s.userInfo, n.userInfoReadyCallback && n.userInfoReadyCallback(s);
          }
        });
      }
    });
    //检测版本更新
    if (wx.canIUse('getUpdateManager')) {
      const updateManager = wx.getUpdateManager()
      updateManager.onCheckForUpdate(function (res) {
        if (res.hasUpdate) {
          updateManager.onUpdateReady(function () {
            wx.showModal({
              title: '更新提示',
              content: '新版本已经准备好，是否重启应用？',
              success: function (res) {
                if (res.confirm) {
                  updateManager.applyUpdate()
                }
              }
            })
          })
          updateManager.onUpdateFailed(function () {
            // 新的版本下载失败
            wx.showModal({
              title: '已经有新版本了哟~',
              content: '新版本已经上线啦，请您删除当前小程序，重新搜索打开哟~'
            })
          })
        }
      })
    }//检测版本更新
  },
  globalData: {
    userInfo: null, csnr: null, appid: null, fxnr: null, fwbjxtext: null, url: "http://api.lqb666.cn/"
  }
});